#ifndef TEXTURE_HPP
#define TEXTURE_HPP

#include "../EngineConfig.hpp"
#include "Utils/Math/Rectangle.hpp"

namespace red {
	/// \brief Wrapper class for OpenGL Texture, load from file with SFML
	class REDAPI Texture{
	public:
		Texture();
		~Texture();

		/// \brief Load the OpenGL Texture from an Image
		/// \param pImage : file path to the image to load
		/// \param pSubRect : SubRect optionnal, subrect of the image
		void LoadFromFile(const std::string &pImage, const Rectangle &pSubRect = Rectangle(0,0,0,0));

		/// \brief Returns the Texture dimensiosn
		Vector2I GetSize() const { return mSize; }

		/// \brief Bind the texture to OpenGL Render State
		void Bind() const;

		/// \brief Unbind the texture
		void UnBind() const;

		/// \brief Destroy the OpenGL Texture
		void Destroy();

	private:
		GLuint mTexture;	/// Texture ID
		Vector2I mSize;		/// Dimensions
		u32 mBPP;			/// Bytes per pixel
		u32 mFormat;		/// Image Format
	};
}
#endif
